package com.kgame5.xtank3d.effect.myemitters {
import kgame5.enginex.enum.Layer3DEnum;
import kgame5.k3d.core.obj3d.node3d.Node3D;

import com.kgame5.xtank3d.effect.MyEmitter;
import com.kgame5.xtank3d.resource.ResourceManagerX;

/**
 * @author kk
 * 爆炸的冲击波，描述爆炸的范围
 */
public class BlastWaveEmitter extends MyEmitter{
	
	//注意这个r就是爆炸的半径,
	public function BlastWaveEmitter(r:int) {
		var md:Node3D=ResourceManagerX.getInstance().getBlastWave(r);
		
		var life:int=5;
		
		var startScale:Number=0.4;
		var aimScale:Number=1;
		var scaleSpeed:Number=(aimScale-startScale)/life;
		var scaleAcc:Number=0.1;
		
		
		var startAlpha:Number=1;
		var aimAlpha:Number=0.4;
		var alphaSpeed:Number=(aimAlpha-startAlpha)/life;
		
		
		
		md.getDO().alpha=startAlpha;
		md.alphaSpeed=alphaSpeed;
		
		
		md.scale.fill(startScale,startScale,startScale);
		md.ti.hardVO.v3d_sv.fill(scaleSpeed,scaleSpeed,scaleSpeed);
		md.ti.hardVO.v3d_sa.fill(scaleAcc, scaleAcc, scaleAcc);
		
		
		md.life=life;
			
		//添加到世界
		md_g.addChild(md);
		md_g.layerID = Layer3DEnum.LAYER_GROUNDMARK;
	}
}
}
